package com.hzit.hzb.core.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.hzit.hzb.core.pojo.entity.LendItemReturn;
import com.hzit.hzb.core.mapper.LendItemReturnMapper;
import com.hzit.hzb.core.service.LendItemReturnService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 标的出借回款记录表 服务实现类
 * </p>
 *
 * @author hbxfwf
 * @since 2024-08-27
 */
@Service
public class LendItemReturnServiceImpl extends ServiceImpl<LendItemReturnMapper, LendItemReturn> implements LendItemReturnService {

	/**
	 * 根据标的id查询还款计划
	 * @param userId
	 * @param lendId
	 * @return
	 */
	@Override
	public List<LendItemReturn> fetchLendItemReturnList(Long userId, Long lendId) {
		return this.list(new QueryWrapper<LendItemReturn>()
				.eq("lend_id",lendId)
				.eq("invest_user_id",userId)
				.orderByAsc("current_period"));
	}
}
